import { Tools } from 'weaver-mobile';
// const catchApiError = (res) => {console.error(res)};

const getModuleOptions = params => Tools.callApi({
	method: 'GET',
	url: '/api/msgcenter/config/getModuleOptions',
	params
});

const loadUserMsgConfig = params => Tools.callApi({
	method: 'GET',
	url: '/api/msgcenter/config/loadUserMsgConfig',
	params
})

const saveUserMsgConfig = params => Tools.callApi({
	method: 'POST',
	url: '/api/msgcenter/config/saveUserMsgConfig',
	params
})

const getWorkflowCondition = params => Tools.callApi({
	method: 'POST',
	url: '/api/msgcenter/config/getWorkflowCondition',
	params
})

const getDetailCondition = params => Tools.callApi({
	method: 'POST',
	url: '/api/msgcenter/config/getDetailCondition',
	params
})

const saveWorkflowDetail = params => Tools.callApi({
	method: 'POST',
	url: '/api/msgcenter/config/saveWorkflowDetail',
	params
})

const saveDetailConfig = params => Tools.callApi({
	method: 'POST',
	url: '/api/msgcenter/config/saveDetailConfig',
	params
})




export {
	getModuleOptions,
	loadUserMsgConfig,
	saveUserMsgConfig,
	getWorkflowCondition,
	getDetailCondition,
	saveWorkflowDetail,
	saveDetailConfig
}
